#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>

#include "bzbcrypto.h"
using namespace bzbcrypto;


TEST_CASE( "bzbcrypto::get_random_secure is being tested", "[single-file]" ) {

	REQUIRE( get_secure_random() != 0 );

}


TEST_CASE( "bzbcrypto::digest_SHA256 is being tested", "[single-file]" ) {

	REQUIRE( digest_SHA256("example") == "50d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c" );

	std::vector<unsigned char> data { 'e', 'x', 'a', 'm', 'p', 'l', 'e' };
	REQUIRE( digest_SHA256(data) == "50d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c" );

	REQUIRE( digest_SHA512("example") ==
"3bb12eda3c298db5de25597f54d924f2e17e78a26ad8953ed8218ee682f0bbbe9021e2f3009d152c911bf1f25ec683a902714166767afbd8e5bd0fb0124ecb8a" );

	REQUIRE( digest_SHA512(data) ==
"3bb12eda3c298db5de25597f54d924f2e17e78a26ad8953ed8218ee682f0bbbe9021e2f3009d152c911bf1f25ec683a902714166767afbd8e5bd0fb0124ecb8a" );

}
